// pages/sign/sign.js
// const util = require('../../utils/util.js')
// const WxParse = require('../wxParse/wxParse.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
		http:getApp().globalData.map,
		num:0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
	  let that=this
	  wx.getStorage({
		  key:'uid',
		  success: (res) => {
		  this.setData({
			  uid:res.data.uid
		  })
		  this.push()
		  }
	  })
  },
  push(){
	  wx.request({
	  	url:getApp().globalData.http+'action=jfPage&uid='+this.data.uid,
	  	success: (e) => {
	  		this.setData({
	  			data:e.data.data,
	  		})
	  	}
	  })
  },
  index(e){
	  console.log(e)
	  this.setData({
		  num:e.detail.current
	  })
  },
  xb(e){
	  this.setData({
	  		  num:e.currentTarget.dataset.id
	  })
  },
  qd(){
	  // ：action=userQD, uid=用户ID 
	  wx.request({
		  url:getApp().globalData.http+'action=userQD&uid='+this.data.uid,
		  success: (e) => {
		  	console.log(e)
			wx.showToast({
				title:e.data.msg
			})
			this.push()
		  }
	  })
  }
})